package org.example.mallweb.mallservice.mybatiscommon.Comment;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.mallcommon.projo.Comment;
import org.example.mallcommon.vo.CommentFatherVo;
import org.example.mallcommon.vo.CommentsSonVo;

import java.util.List;

@Mapper
/**
 * @author 韩先楚
 * 评论表
 */

public interface CommentMapper extends BaseMapper<Comment> {
    /**
     * 查询父评论
     * @param commentFatherVoPage
     * @param articleId
     * @return
     */
    Page<CommentFatherVo> selectFatherComments(Page<CommentFatherVo> commentFatherVoPage, @Param("articleId") Long articleId);

    // 查询子评论
    List<CommentsSonVo> selectChildComments(@Param("fatherId") Long fatherId);

    // 根据父评论id获取昵称
    String getFatherNickname(@Param("fatherId") Long fatherId);
}
